using Assets.Scripts.GDK;
using System.Diagnostics;

namespace Brick
{
	public class EnemyBoxModule : gdk_base_Imodule
	{
		private LevelData curGameCfg;

		public LevelData loadGameConfigJson(int level)
		{
			string id = "Level/Level_" + level.ToString() + "_cfg";
            //JsonMapper.ToObject<LevelData>(json);
            return curGameCfg = gdk_game_manager.loadJsonS<LevelData>(id);
		}

		public int getStarLevel(int starIndex)
		{
			return curGameCfg.Star[starIndex - 1];
		}

		public int getStar(int score)
		{
			for (int num = 2; num >= 0; num--)
			{
				if (score >= curGameCfg.Star[num])
				{
					return num + 1;
				}
			}
			return 0;
		}
	}
}

